<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<RMH.Entities.Stay>" %>
<%@ Import Namespace="RMH.Web"%>
<%@ Import Namespace="RMH.Entities"%>
<%@ Import Namespace="RMH.Web.Controllers"%>
<%@ Import Namespace="Microsoft.Web.Mvc"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Ronald McDonald House - Edit Stay
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<%
    if(Model.Payment == null) Model.Payment = new Payment();
%>

    <h2>Edit Stay for <%= Html.Encode(ViewData["ForPatient"])%></h2>
    

    <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm("Edit", "Stay")) {%>

        <fieldset>
            <legend>Stay Details</legend>
            <%= Html.Hidden("Id", Model.Id)%>
            <%= Html.Hidden("CheckinBy", Model.CheckinBy)%>
            <%= Html.Hidden("CheckoutBy", Model.CheckoutBy)%>
            <%= Html.Hidden("PatientId", Model.Patient == null ? 0 : Model.Patient.Id)%>
            
            <div class="leftColumn">
            <p>
                <label for="CheckinDate">Check In Date:</label>
                <%= Html.TextBoxFor(p => p.CheckinDate, Html.DateOptions())%>                
                <%= Html.ValidationMessage("CheckinDate", "*") %><br />
                By: <%= Html.Encode(Model.CheckinBy)%>
            </p>    
            
            <p>
                <label for="PreauthorizationApprovedDate">Preauthorization Approved Date:</label>
                <%= Html.TextBoxFor(p => p.PreauthorizationApprovedDate, Html.DateOptions())%>                
                <%= Html.ValidationMessage("PreauthorizationApprovedDate", "*") %>
            </p>
            
            <p>
                <label for="HospitalUnit">Hospital Unit:</label>
                <%= Html.TextBox("HospitalUnit", Model.HospitalUnit) %>
                <%= Html.ValidationMessage("HospitalUnit", "*") %>
            </p>
            <p>
                <label for="HospitalRoomNumber">Hospital Room Number:</label>
                <%= Html.TextBox("HospitalRoomNumber", Model.HospitalRoomNumber) %>
                <%= Html.ValidationMessage("HospitalRoomNumber", "*") %>
            </p>
            
            </div>
            

             <p>
                <label for="CheckoutDate">Check Out Date:</label>
                <%= Html.TextBoxFor(p => p.CheckoutDate, Html.DateOptions())%>          
                <%= Html.ValidationMessage("CheckoutDate", "*") %><br />
                By: <%= Html.Encode(Model.CheckoutBy)%>
            </p>   
            
            <p>
                <label for="PreauthorizationSentDate">Preauthorization SentDate:</label>
                <%= Html.TextBoxFor(p => p.PreauthorizationSentDate, Html.DateOptions())%>                
                <%= Html.ValidationMessage("PreauthorizationSentDate", "*") %>
            </p>
            <p>
                <label for="RoomId">Room:</label>
                <%= Html.DropDownList("RoomId", (IEnumerable<SelectListItem>)ViewData["Rooms"])%>
                <%= Html.ValidationMessage("RoomId", "*") %>
            </p>

            <p>
                <label for="HospitalPhoneNumber">Hospital Phone Number:</label>
                <%= Html.TextBox("HospitalPhoneNumber", Model.HospitalPhoneNumber) %>
                <%= Html.ValidationMessage("HospitalPhoneNumber", "*") %>
            </p>
            <p>
                <label for="MedicaidNumber">Medicaid Number:</label>
                <%= Html.TextBox("MedicaidNumber", Model.MedicaidNumber) %>
                <%= Html.ValidationMessage("MedicaidNumber", "*") %>
            </p>
            <p>
                <label for="SocialWorkerName">Social Worker Name:</label>
                <%= Html.TextBox("SocialWorkerName", Model.SocialWorkerName) %>
                <%= Html.ValidationMessage("SocialWorkerName", "*") %>
            </p>
        </fieldset>
        
        <fieldset>
            <legend>Payment Details</legend>
             <div class="leftColumn">
            <p>
                <label for="Payment.Amount">Amount:</label>
                <%= Html.HiddenFor(p=>p.Payment.Id)%>
                <%= Html.TextBoxFor(p=>p.Payment.Amount)%>
           </p>
           <p>
                <label for="Payment.BillingDate">Billing Date:</label>
                <%= Html.TextBoxFor(p => p.Payment.BillingDate, Html.DateOptions())%>
           </p>
           
           <p>
                <label for="Payment.CheckNumber">Check Number:</label>
                <%= Html.TextBoxFor(p=>p.Payment.CheckNumber)%>  
           </p>
           </div>
           <p>
                <label for="Payment.Method">Payment Method:</label>            
                 <%= Html.DropDownList("Payment.Method", (IEnumerable<SelectListItem>)ViewData["PaymentMethods"])%>
           </p>
           <p>
                <label for="Payment.ReceivedDate">Received Date:</label>
                <%= Html.TextBoxFor(p => p.Payment.ReceivedDate, Html.DateOptions())%>
           </p>
           <p>
                <label for="Payment.Type">Payment Type:</label>
                <%= Html.DropDownList("Payment.Type",(IEnumerable<SelectListItem>)ViewData["PaymentTypes"])  %>
            </p>
            
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    <% } %>


</asp:Content>

